LLM Workflow Tip: Fetch YouTube Transcript via SupaData API

Added at: August 6, 2025

Declaration


youtube_transcript() {
  if [[ -z $SUPADATA_API_KEY ]]; then
    echo "Warning: SUPADATA_API_KEY is not set" >&2
    return 1
  fi

  if (( $# != 1 )); then
    echo "Usage: youtube_transcript <YouTube-URL>" >&2
    return 1
  fi

  curl -s -G \
    "https://api.supadata.ai/v1/youtube/transcript" \
    --data-urlencode "url=$1" \
    --data-urlencode "text=true" \
    -H "x-api-key: $SUPADATA_API_KEY"
}
    

Usage

  1. youtube_transcript <youtube_video_url> > ~/tmp/<temp-file-name>
  2. Pipe and process:
    cat ~/tmp/<temp-file-name> | jq ".content" | \ llm -m "o4-mini" -s "This is the transcript of an informative youtube video. Summarize it exhaustively, but leave all platitude, ads and filler content out of it." | \ llm -m "o4-mini" -s "Group by themes and summarize further." | \ pbcopy
  3. Paste into your favorite note-taking tool.